﻿using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;

namespace EmailExtractor
{
    class EmailExtractor
    {
        static List<string> ExtractEmails(string text)
        {
            List<string> emails = new List<string>();
            string pattern = @"\b[\w\.]+@[\w\.]+\.[a-zA-z]{2,4}\b";
            Regex regex = new Regex(pattern);
            Match match = regex.Match(text);
            while (match.Success)
            {
                emails.Add(match.Value);
                match = match.NextMatch();
            }
            return emails;
        }

        static void Main()
        {
        }
    }
}
